package cn.wolfcode.crm.service.impl;


import cn.wolfcode.crm.domain.SystemLog;
import cn.wolfcode.crm.mapper.SystemLogMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by abb on 2018-07-09.
 */
@Service
public class SystemLogServiceImpl implements ISystemLogService {
    @Autowired
    SystemLogMapper systemLogMapper;

    @Override
    public void deleteByPrimaryKey(Long id) {
        systemLogMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insert(SystemLog entity) {
        systemLogMapper.insert(entity);
    }

    @Override
    public SystemLog selectByPrimaryKey(Long id) {
        return systemLogMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SystemLog> selectAll() {
        return systemLogMapper.selectAll();
    }

    @Override
    public void updateByPrimaryKey(SystemLog entity) {
        systemLogMapper.updateByPrimaryKey(entity);
    }

    @Override
    public PageResult query(QueryObject qo) {
        int total = systemLogMapper.queryForCount(qo);
        List<SystemLog> rows = systemLogMapper.queryForList(qo);
        return new PageResult(total,rows);
    }
    
}
